package org.pzy.redis.controller;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author pzy
 * @date 2024/6/5
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @GetMapping
    @Cacheable(cacheNames = "demo:getMsg", key = "#key")
    public String getMsg(String key, String value) {
        return value;
    }
}
